//
//  UIImageView+BCWebImage.h
//  BCWebImageKit
//
//  Created by Basic on 2018/5/24.
//  UIImageView web图片加载扩展

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIImageView (BCWebImage)
/** 占位图背景色，默认nil */
@property (nonatomic, strong, nullable) UIColor *bc_placeholderColor;
/** 占位图 内容模式,见 枚举 UIViewContentMode */
@property (nonatomic, assign) UIViewContentMode bc_placeholderContentMode;

//MARK: - public
/**
 根据图片URL设置图片,可设置默认图

 @param imageStr 图片URL
 @param placeHolderImage 默认图
 */
- (void)bc_setImageWithURL:(NSString * _Nullable)imageStr placeHolderImage:(UIImage * _Nullable)placeHolderImage;

/// 根据 width constraints 约束或者 view frame 大小来下载图片，并设置图片，可设置默认图
/// @param imageStr 图片URL
/// @param placeHolderImage 占位图
- (void)bc_setSameWidthImageWithURL:(NSString * _Nullable)imageStr placeHolderImage:(UIImage *_Nullable)placeHolderImage;

/**
 根据图片URL、宽度设置图片，可设置默认图

 @param imageStr 图片URL
 @param widthStr 图片宽度
 @param placeHolderImage 默认图
 */
- (void)bc_setImageWithURL:(NSString * _Nullable)imageStr width:(NSString *)widthStr placeHolderImage:(UIImage * _Nullable)placeHolderImage;


/**
 根据图片URL设置图片，可设置默认图、完成回调

 @param imageStr 图片URL
 @param placeholderImage 默认图片
 @param complete 完成回调
 */
- (void)bc_setImageWithURL:(NSString * _Nullable)imageStr placeholderImage:(UIImage * _Nullable)placeholderImage complete:(void(^ _Nullable)(BOOL success, UIImage * _Nullable image, UIImageView * _NullableimageView) )complete;

///  根据图片URL返回圆角图片，可设置默认图、完成回调
/// @param imageStr imageStr description
/// @param radius radius description
/// @param placeHolderImage placeHolderImage description
- (void)bc_setImageWithURL:(NSString * _Nullable)imageStr radius:(CGFloat)radius placeHolderImage:(UIImage * _Nullable)placeHolderImage;

@end

NS_ASSUME_NONNULL_END
